<template>
	<view>
		<u-navbar :back-text="backText" 
			:background="{background:background}" 
			:back-icon-color="backColor"
			:title="title"
			:title-color="backColor"
			@customBack="back"
			:border-bottom="borderBottom"></u-navbar>
	</view>
</template>

<script>
	
	export default{
		props:{
			backText:{
				type: String,
				default: '返回'
			},
			background:{
				type:String,
				default:'#f2f2f2'
			},
			borderBottom:{
				type:Boolean,
				default:false
			},
			backColor:{
				type:String,
				default:'#333'
			},
			title:{
				type:String,
				default:''
			}
		},
		methods:{
			back(){
				let pages = getCurrentPages();
				if (pages.length <= 1){
					uni.redirectTo({
						url: '/'
					});
				}else{
					uni.navigateBack({
						delta: 1
					});
				}
				return false;
				this.$app.goPage(-1)
			}
		}
	}
</script>

<style>
</style>
